import VueRouter from 'vue-router'
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import ShopCarContainer from './components/tabbar/ShopCarContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import NewsList from './components/news/NewList.vue'
import NewsInfo from './components/news/NewsInfo.vue'
import PhotoList from './components/photos/PhotoList.vue'
import PhotoInfo from './components/photos/PhotoInfo.vue'
import GoodsList from './components/goods/GoodList.vue'
import GoodsInfo from './components/goods/GoodsInfo.vue'
import GoodDesc from './components/goods/GoodDesc.vue'
import GoodsComment from './components/goods/GoodsComment.vue'
// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    //path中的路径与router-link 中的to保持一致
    { path: '/', redirect: '/homes' },
    { path: '/homes', component: HomeContainer },
    { path: '/member', component: MemberContainer },
    { path: '/shopcar', component: ShopCarContainer },
    { path: '/search', component: SearchContainer },
    { path: '/homes/newslist', component: NewsList },
    { path: '/homes/newsinfo/:id', component: NewsInfo },
    { path: '/homes/photolist', component: PhotoList },
    { path: '/homes/photoinfo/:id', component: PhotoInfo },
    { path: '/homes/goodslist', component: GoodsList },
    { path: '/homes/goodsinfo/:id', component: GoodsInfo },
    { path: '/homes/goodsdesc/:id', component: GoodDesc, name: 'gooddesc' },
    { path: '/homes/goodscomment/:id', component: GoodsComment, name: 'goodscomment' }


  ],
  linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router